home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
START Magazine
/
START VOL 3 NO 8.st
/
COLRBOOK.ARC
/
COLRBOOK.LST
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
File List
|
1988-12-06
|
32.9 KB
|
1,487 lines
' *********************************************
' ST Coloring Book
'
' By Richard Farrell
'
' Copyright 1988 Antic Publishing Inc.
' *********************************************
' Global A$=Branch command
' Global Z$=Last routine before entering branch loop
' Global Z2$=Last drawing routine, Used for Undo
Cls
Hidem
Dim Palette(15),Sa%(15),Oa%(15)
True=-1
False=0
Pcture%=1
Z2$="P"
Dd%=5
Default$="\*.*"
@Check_rez
@Get_drive
Bootdrive$=Currentdrive$
@Original_path
@Set_rez
@Title
P%=0
Repeat
Setcolor P%,0,0,0
Inc P%
Until P%=16
@Set_colors
Get 0,20,319,199,Screen1$
Get 0,20,319,199,Screen2$
Get 0,20,319,199,Bottom$
On Error Gosub Trap_error
Color_point%=2
Deffill 2,2,8
@Auto_load
If Answer%=1 !if load unsuccessfull
Pcture%=0
A$="M"
Else
@Set_color_point
A$="P"
Endif
Trap_1:
' -------------------------------------------------
Do !Main Branching Loop
Void Fre(0) !Garbage Collection
If Asc(A$)=32
@Main_menu
Else
If A$="Page F"
Alert 1,"|PAGING PICTURE WILL ABANDON | YOUR WORK ON THIS SCREEN.",1,"OK|CANCEL",Ab%
If Ab%=1
Inc Pcture%
@Auto_load
If Answer%=1
Dec Pcture%
A$=Z$
Else
A$="P"
@Set_color_point
Endif
Else
A$=Z$
Endif
Else
If A$="Page B"
Alert 1,"|PAGING PICTURE WILL ABANDON | YOUR WORK ON THIS SCREEN.",1,"OK|CANCEL",Ab%
If Ab%=1
Dec Pcture%
If Pcture%=0
@Find_screen_number
Endif
@Auto_load
If Answer%=1 !unsuccessful load
Inc Pcture%
A$=Z$
Else
A$="P"
@Set_color_point
Endif
Else
A$=Z$
Endif
Else
If A$="Undo"
@Change_screen
A$=Z$
If A$="M"
A$=Z2$
Endif
Else
If A$="Clear"
@Clear_screen
A$=Z$
Else
If Upper$(A$)="M"
@Main_menu
Else
If Upper$(A$)="C"
@Reset_colors
A$=Z$
Else
If Upper$(A$)="P"
@Paint
Else
If Upper$(A$)="E"
@Erase
Else
If Upper$(A$)="D"
@Draw_1
Else
If Upper$(A$)="R"
@Draw_2
Else
If Upper$(A$)="S"
@Save_screen
A$=Z$
Else
If Upper$(A$)="L"
Put 0,0,Top_black$
Print At(1,1);"LOAD PICTURE"
@Fileselect(Default$,"",0,"")
@Load_screen
@Set_color_point
A$=Z$
Else
If Asc(A$)>48 And Asc(A$)<58 !Key pad
@Adjust_color(A$)
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Repeat !Clears multiple key press
Until Inkey$=""
Loop
' ------------------------------------------
Procedure Adjust_color(A$)
Local R%,G%,B%,C%,D,X%
If Color_point%>1
Restore Color_place
Repeat
Read X%,Color_place%
Until Color_point%=X%
X%=Sa%(Color_place%)
R%=Int(X%/256)
Sub X%,R%*256
G%=Int(X%/16)
Sub X%,G%*16
B%=X%
C%=Asc(A$)-48
If C%=1
Dec B%
Else
If C%=3
Inc B%
Else
If C%=4
Dec G%
Else
If C%=6
Inc G%
Else
If C%=7
Dec R%
Else
If C%=9
Inc R%
Endif
Endif
Endif
Endif
Endif
If R%>7
R%=7
Endif
Endif
If G%>7
G%=7
Endif
If B%>7
B%=7
Endif
If R%<0
R%=0
Endif
If G%<0
G%=0
Endif
If B%<0
B%=0
Endif
Setcolor Color_place%,R%,G%,B%
X%=R%*256+G%*16+B%
Sa%(Color_place%)=X%
@Color_numbers
Endif
Return
' ----------------------------------------------
Procedure Adjust_color_choice(T%)
If T%=43 Or T%=61
Inc Color_point%
If Color_point%>15
Color_point%=1
Endif
Else
Dec Color_point%
If Color_point%<1
Color_point%=15
Endif
Endif
Deffill Color_point%,2,8
@Set_color_marker
Pause 8
Repeat
Until Inkey$=""
A$=""
Return
' -----------------------------------------------
Procedure Auto_load
Answer%=1
Filename$=Bootdrive$+":"+Oldpath$+"SCREEN"+Str$(Pcture%)+".NEO"
If Exist(Filename$)
@Load_screen
Answer%=0 !load successfull
Else
Filename$=Bootdrive$+":"+Oldpath$+"SCREEN"+Str$(Pcture%)+".PI1"
If Exist(Filename$)
@Load_screen
Answer%=0 !load successfull
Else
Filename$=Bootdrive$+":"+Oldpath$+"SCREEN"+Str$(Pcture%)+".PC1"
If Exist(Filename$)
@Load_screen
Answer%=0 !load successfull
Else
If Pcture%<>1
Pcture%=1
@Auto_load
Endif
Endif
Endif
Endif
Return
' -----------------------------------------------
Procedure Change_screen
Swap Screen1$,Screen2$
Put 0,20,Screen1$
Return
' ---------------------------------------------------
Procedure Check_rez
Local X%
X%=Xbios(4)
If X%<>0
Alert 1,"|KID'S COLORING BOOK| ONLY WORKS IN| LOW RESOLUTION!",1,"OK",X%
End
Endif
Return
' ---------------------------------------------
Procedure Clear_screen
Local X%
Alert 2,"| CLEARING THE SCREEN WILL|ERASE YOUR CURRENT DRAWING| DO YOU WISH TO CLEAR IT?",1,"YES|NO",X%
If X%=1
Screen1$=Bottom$
Endif
Return
' --------------------------------------------------------
Procedure Color_numbers
Local X%,Y%,R%,G%,B%
Restore Color_place
Repeat
Read X%,Color_place%
Until Color_point%=X%
X%=Val(Str$(Sa%(Color_place%)))
R%=Int(X%/256)
Sub X%,R%*256
G%=Int(X%/16)
Sub X%,G%*16
B%=X%
If R%>7
R%=7
Endif
If G%>7
G%=7
Endif
If B%>7
B%=7
Endif
If R%<0
R%=0
Endif
If G%<0
G%=0
Endif
If B%<0
B%=0
Endif
Deftext 1,0,0,4
Text 271,4,"R"+Str$(R%)
Text 271,10,"G"+Str$(G%)
Text 271,16,"B"+Str$(B%)
Return
' -----------------------------------------------
Procedure Default_path
Local Default_drive$
Default_drive$=Chr$(Gemdos(25)+65)
Drive$=Default_drive$+":"+Dir$(Gemdos(25)+1)+"\"
Return
' ------------------------------------------------
Procedure Display_color_text(C%)
Local A$
If C%=0
A$="DRAW "
Else
A$="ERASE"
Endif
Print At(1,2);A$
Return
' --------------------------------------------------
Procedure Do_fill(X%,Y%)
If Color_point%<>0
Fill X%,Y%
Swap Screen1$,Screen2$
Get 0,20,319,199,Screen1$
Endif
Return
' -------------------------------------------------
Procedure Draw_1
Local A%,B%
A%=0
Z$="D"
Z2$=Z$
B%=7
Restore Pencil_data
@Read_mouse_data
Color 0
Put 0,0,Top_black$
Put 0,20,Screen1$
@Recolor
Color 1
Print At(1,2);"DRAW FREEHAND"
Box 290,1,318,18
Box 295,6,313,13
Line 290,1,295,6
Line 318,1,313,6
Line 290,18,295,13
Line 318,18,313,13
Color 0
Do
Mouse X%,Y%,Z%
While Z%=0 And X%>=289 And Y%<18
If B%<>3
Restore Pointfinger_data
@Read_mouse_data
B%=3
Endif
Mouse X%,Y%,Z%
A$=Inkey$
If Z%=1
A$="M"
Endif
Exit If A$<>""
Wend
If B%<>7
B%=7
Restore Pencil_data
@Read_mouse_data
Endif
Exit If A$="M"
While Z%=1 And Y%>=20
Mouse X%,Y%,Z%
Mouse X1%,Y1%,Z%
While Z%=1 And Y1%>=20
Mouse X1%,Y1%,Z%
Line X%,Y%,X1%,Y1%
X%=X1%
Y%=Y1%
Pause 1
A%=1
Wend
Wend
If A%=1
A%=0
Swap Screen1$,Screen2$
Get 0,20,319,199,Screen1$
Endif
If Len(A$)=2
@Special_key
Endif
B$=Upper$(A$)
Exit If ((Asc(B$)=32)+(B$="M")+(B$="E")+(B$="R")+(B$="P"))=True
Exit If ((B$="L")+(B$="S")+(B$="C"))=True
A$=Inkey$
Loop
Return
' --------------------------------------
Procedure Draw_2
Local A%,B%
A%=0
B%=5
Z$="R"
Z2$=Z$
Restore Opencross_data
@Read_mouse_data
Put 0,0,Top_black$
Put 0,20,Screen1$
@Recolor
Color 1
Print At(1,2);"DRAW RUBBERBAND LINES"
Box 290,1,318,18
Box 295,6,313,13
Line 290,1,295,6
Line 318,1,313,6
Line 290,18,295,13
Line 318,18,313,13
Color 0
Local P%
A$=""
B$=""
Place%=0
Do
Mouse X%,Y%,Z%
While Z%=0 And X%>=289 And Y%<18
If B%<>3
B%=3
Restore Pointfinger_data
@Read_mouse_data
Endif
Mouse X%,Y%,Z%
A$=Inkey$
If Len(A$)=2
@Special_key
Endif
If Z%=1
A$="M"
B$="M"
Endif
Exit If A$<>""
Wend
If B%<>5
B%=5
Restore Opencross_data
@Read_mouse_data
Endif
Exit If ((Asc(B$)=32)+(B$="M")+(B$="E")+(B$="D")+(B$="P"))=True
Exit If ((B$="L")+(B$="S")+(B$="C"))=True
A$=Inkey$
B$=Upper$(A$)
If Len(A$)=2
@Special_key
Endif
If Z%=1
@Draw_2_a(X%,Y%)
Endif
Loop
Graphmode 1
Return
' ----------------------------------
Procedure Draw_2_a(X%,Y%)
Repeat
Until Mousek=0
Z%=0
While Z%=0 And Y%>=20
Graphmode 3
Mouse X1%,Y1%,Z%
If Y1%>=20
Line X%,Y%,X1%,Y1%
Line X%,Y%,X1%,Y1%
Endif
A$=Inkey$
Mouse A%,D%,C%
While A%>=290 And D%<20
If B%<>3
B%=3
Restore Pointfinger_data
@Read_mouse_data
Endif
Mouse A%,D%,C%
A$=Inkey$
If C%=1
A$="M"
Endif
Exit If A$<>""
Wend
If B%<>5
B%=5
Restore Opencross_data
@Read_mouse_data
Endif
B$=Upper$(A$)
Exit If ((Asc(B$)=32)+(B$="M")+(B$="E")+(B$="D")+(B$="P"))=True
Exit If ((B$="L")+(B$="S")+(B$="C"))=True
Pause 1
Wend
If Z%=1 And Y1%>=20
@Draw_2_b(X%,Y%,X1%,Y1%)
Endif
Return
' -----------------------------------------
Procedure Draw_2_b(X%,Y%,X1%,Y1%)
Graphmode 1
Swap Screen1$,Screen2$
Line X%,Y%,X1%,Y1%
Repeat
Until Mousek=0
Get 0,20,319,199,Screen1$
@Draw_2_a(X1%,Y1%)
Return
' -------------------------------
Procedure Early_exit
@Get_colors
Alert 1,"| ST COLORING BOOK|IS MISSING SCR FILES",1,"OK",X
P%=0
Repeat
Setcolor P%,Palette(P%)
Inc P%
Until P%=16
Deftext 1,0,0,13
Chdrive Old_drive% !Reset Drive path
Chdir Oldpath$
End
Return
' -------------------------------------
Procedure Erase
@Recolor
Local A%,B%,C%
A%=0
B%=0
C%=0
Z$="E"
Z2$=Z$
Put 0,0,Top_black$
Put 0,20,Screen1$
Color 1
Print At(1,2);"ERASE (USE 1-9 TO CHANGE SIZE)"
Box 290,1,318,18
Box 295,6,313,13
Line 290,1,295,6
Line 318,1,313,6
Line 290,18,295,13
Line 318,18,313,13
Color 0
Restore Pointfinger_data
@Read_mouse_data
Hidem
Y_dd%=Dd%
Old_y_dd%=Dd%
Deffill 1,2,8
Do
Mouse X%,Y%,Z%
While Z%=0 And X%>=289 And Y%<18
Mouse X%,Y%,Z%
A$=Inkey$
Showm
If Z%=1
A$="M"
Endif
Exit If A$<>""
Wend
Hidem
Exit If A$="M"
Graphmode 3
Box X%-Dd%,Y%-Y_dd%,X%+Dd%,Y%+Dd%
Box X%-Dd%,Y%-Y_dd%,X%+Dd%,Y%+Dd%
While Z%=1 And Y%>=20-Dd%
Mouse X%,Y%,Z%
Graphmode 3
Box X%-Dd%,Y%-Y_dd%,X%+Dd%,Y%+Dd%
Box X%-Dd%,Y%-Y_dd%,X%+Dd%,Y%+Dd%
Zz%=Y%-Y_dd%
If Y%-Y_dd%<=20
Y_dd%=(Y%-20)
Zz%=20
Endif
Za%=Y%+Dd%
If Za%<20
Za%=20
Endif
Graphmode 1
Pbox X%-Dd%,Zz%,X%+Dd%,Za%
Pause 1
Y_dd%=Old_y_dd%
C%=1
Wend
If C%=1 And Z%=0
Pause 1
C%=0
Swap Screen1$,Screen2$
Get 0,20,319,199,Screen1$
Endif
If Len(A$)=2
Graphmode 1
@Special_key
Endif
B$=Upper$(A$)
Exit If ((Asc(B$)=32)+(B$="M")+(B$="D")+(B$="R")+(B$="P"))=True
Exit If ((B$="L")+(B$="S")+(B$="C"))=True
B%=Asc(A$)
A%=Abs((B%=49)*1+(B%=50)*2+(B%=51)*3+(B%=52)*4+(B%=53)*5+(B%=54)*6+(B%=55)*8+(B%=56)*15+(B%=57)*30)
If A%<>0
Dd%=A%
Y_dd%=Dd%
Old_y_dd%=Dd%
Endif
A$=Inkey$
Loop
Showm
Graphmode 1
Deffill Color_point%,2,8
Return
' -----------------------------------
Procedure Find_screen_number
X%=0
Pcture%=99
Repeat
Filename$=Bootdrive$+":"+Oldpath$+"SCREEN"+Str$(Pcture%)+".NEO"
If Exist(Filename$)
X%=1
Else
Filename$=Bootdrive$+":"+Oldpath$+"SCREEN"+Str$(Pcture%)+".PI1"
If Exist(Filename$)
X%=1
Endif
Endif
Exit If X%=1
Dec Pcture%
Until Pcture%=1
Return
' -----------------------------------------------------
Procedure Fileselect(A$,File$,Ex%,Extension$) !ex%=1 to add extension$
Setcolor 15,0,0,0 !black
Setcolor 0,7,7,7 !white
Local X%
Clr Filename$,Filename_2$,New_drive$,New_drive%,Path$,B$
@Get_drive
If Left$(A$,1)<>"\"
A$="\"+A$
Endif
Repeat
Fileselect Currentdrive$+":"+Dir$(0)+A$,File$,Filename_2$
Exit If Filename_2$=""
Until Len(Filename_2$)<>1
If Filename_2$<>""
Currentpath$=Dir$(0)
If Currentpath$=""
Currentpath$="\"
Endif
X%=Len(Filename_2$)
Currentdir$=Dir$(0)
For Y%=X% To 1 Step -1
If Mid$(Filename_2$,Y%,1)="\"
B$=Right$(Filename_2$,(X%-Y%))
Path$=Left$(Filename_2$,(Len(Filename_2$)-Len(B$)))
If Mid$(Path$,2,1)=":"
New_drive$=Left$(Path$,1)
New_drive%=Asc(New_drive$)-Asc("A")+1
Endif
Y%=1
Endif
Next Y%
Filename$=Path$+B$
@Get_drive
If New_drive%<>0
Chdrive New_drive%
Endif
Chdir Path$
Endif
Full_path$=Filename_2$
If Ex%=1 And Instr(B$,".")=0
B$=B$+"."+Extension$
Filename$=Filename$+"."+Extension$
Endif
Setcolor 0,0,0,0 !black
Setcolor 15,7,7,7 !white
Return
' -----------------------------------------------------
Procedure Get_drive
Currentdrive%=Gemdos(&H19)
Currentdrive$=Chr$(Asc("A")+Currentdrive%)
Boot_drive%=Currentdrive%+1
Return
' ---------------------------------------------------------
Procedure Get_colors
Local P%
Setcolor 0,0,0,0 !black
Setcolor 15,7,7,7 !white
Setcolor 1,0,0,4 !blue dark
Setcolor 2,0,0,7 !blue
Setcolor 4,0,5,7 !turquiose
Setcolor 6,4,1,7 !purple blue
Setcolor 3,7,0,7 !purple red
Setcolor 5,5,0,0 !red dark
Setcolor 7,7,0,0 !red
Setcolor 8,7,4,4 !flesh
Setcolor 9,7,4,0 !orange
Setcolor 10,7,7,0 !yellow
Setcolor 12,7,6,4 !sand
Setcolor 14,0,7,0 !green
Setcolor 11,0,4,0 !green dark
Setcolor 13,0,5,4 !green blue
Return
' ------------------------------------------
Procedure Help
Local A$,P%
Hidem
Sget Screen$
@Get_colors
Sput Help$
Repeat
Exit If Inkey$<>""
Until Mousek<>0
Repeat
Until Mousek=0
Sput Screen$
P%=0
Repeat
Setcolor P%,Sa%(P%)
Inc P%
Until P%=16
Showm
Return
' -------------------------------------------
Procedure Load_screen
Local P%,X%,D$
If Filename$<>""
Cls
R$=Right$(Filename$,3)
If R$="PI1" ! DEGAS picture selected
Bload Filename$,Xbios(2)-34
@Load_info_for_degas
Else
If R$="PC1"
@Load_degas_compressed
@Load_info_for_degas
Else
If R$="NEO" ! NEO picture selected
Bload Filename$,Xbios(2)-128
A%=Xbios(2)-124
P%=0
Repeat
Oa%(P%)=Sa%(P%)
Sa%(P%)=Dpeek(A%)
Setcolor P%,Sa%(P%)
Add A%,2
Inc P%
Until P%=16
Setcolor 0,0,0,0 !black
Setcolor 15,7,7,7 !white
@Set_colors
Swap Screen1$,Screen2$
Get 0,20,319,199,Screen1$
If Z$="M"
Z$="P"
Endif
If Instr(Filename$,"SCREEN")>1
X%=Instr(Filename$,"SCREEN")+6
Y%=Len(Filename$)
D$=Right$(Filename$,Y%-X%+1)
Pcture%=Val(D$)
Endif
Else
Alert 1,"|PICTURES FILES MUST BE IN| NEOCHROME OR DEGAS| FORMAT.",1,"OK",X
Endif
Endif
Endif
Endif
Return
' ----------------------------------------------------
Procedure Load_degas_compressed
Local P%
' Thanks to Jim Kent for this routine to read a compressed picture.
Unpack$=Space$(15*4)
Unpac=Varptr(Unpack$)
Restore Unpack
For I=1 To 15
Read X
Lpoke Unpac,X
Unpac=Unpac+4
Next I
Unpac=Varptr(Unpack$)
Unrave$=Space$(10*4)
Unrav=Varptr(Unrave$)
Restore Unravel
For I=1 To 10
Read X
Lpoke Unrav,X
Unrav=Unrav+4
Next I
Unrav=Varptr(Unrave$)
Temp$=Space$(32760)
P%=Varptr(Temp$)
Bload Filename$,P%
Screen%=Xbios(2)
Print Screen%
Temp2$=Space$(40)
B%=Varptr(Temp2$)
Picture.res=Dpeek(P%)
P%=P%+2
For I%=0 To 15
Setcolor I%,Dpeek(P%)
P%=P%+2
Next I%
'
For K%=1 To 200
Scr%=Screen%
For C%=1 To 4
P%=C:Unpac(L:P%,L:B%,40)
Q%=C:Unrav(L:B%,L:Scr%,40,8)
Scr%=Scr%+2
Next C%
Screen%=Screen%+160
Next K%
Unpack:
Data &h48e740e0,&h206f0014,&h226f0018,&h2449d4ef
Data &h001c4241,&h12186b0c,&h12d851c9,&hfffcb3ca
Data &h6df0600e,&h44011018,&h12c051c9,&hfffcb3ca
Data &h6de02008,&h4cdf0702,&h4e750000
Unravel:
Data &h48e740c0,&h206f0010,&h226f0014,&h302f0018
Data &h322f001a,&he2486004,&h3298d2c1,&h51c8fffa
Data &h4cdf0302,&h4e750000
Return
' ------------------------------------------------------
Procedure Load_info_for_degas
A%=Xbios(2)-32
P%=0
Repeat
Oa%(P%)=Sa%(P%)
Sa%(P%)=Dpeek(A%)
Setcolor P%,Sa%(P%)
Add A%,2
Inc P%
Until P%=16
Setcolor 0,0,0,0 !black
Setcolor 15,7,7,7 !white
@Set_colors
Swap Screen1$,Screen2$
Get 0,20,319,199,Screen1$
If Z$="M"
Z$="P"
Endif
If Instr(Filename$,"SCREEN")>1
X%=Instr(Filename$,"SCREEN")+6
Y%=Len(Filename$)
D$=Right$(Filename$,Y%-X%+1)
Pcture%=Val(D$)
Endif
Return
' ------------------------------------------------
Procedure Make_help_screen
Local A$,P%
Hidem
Restore Help_screen_data
Read A$
Deffill 2,2,8
Pbox 0,0,319,199
Deftext 1,0,0,6
Color 1
Print At(16,1);"INFORMATION"
P%=20
While A$<>"-1"
Text 10,P%,A$
Read A$
Add P%,9
Wend
Sget Help$
Return
' --------------------------------------
Procedure Main_menu
Local A%,B%,P%,X%,Y%,Z%,B$
Z$="M"
Color 0
Restore Pointfinger_data
@Read_mouse_data
@Get_colors
Sput Mnu$
Do
A$=Inkey$
If Len(A$)=2
@Special_key
Endif
B$=Upper$(A$)
Exit If ((B$="D")+(B$="E")+(B$="R")+(B$="P"))=True
Exit If ((B$="L")+(B$="S"))=True
Mouse X%,Y%,Z%
If Z%=1
Repeat
Until Mousek=0
A%=Abs((X%>=31 And X%<=96)*1+(X%>=127 And X%<=192)*2+(X%>=223 And X%<=288)*3)
B%=Abs((Y%>=36 And Y%<=60)*1+(Y%>=76 And Y%<=100)*2+(Y%>=116 And Y%<=140)*3+(Y%>=156 And Y%<=180)*4)
If (X%>=126 And X%<=288) And (Y%>=36 And Y%<=60)
A%=2
Endif
Endif
If A%*B%>0
If A%=1 And B%=1
A$="D"
Else
If A%=2 And B%=1
A$="P"
Else
If A%=3 And B%=1
A$="P"
Else
If A%=1 And B%=2
A$="R"
Z$="P"
Else
If A%=2 And B%=2
A$="Page B"
Z$="M"
Else
If A%=3 And B%=2
A$="Page F"
Z$="M"
Else
If A%=1 And B%=3
A$="Undo"
Else
If A%=2 And B%=3
A$="L"
Z$="M"
Else
If A%=3 And B%=3
A$="S"
Z$="M"
Else
If A%=1 And B%=4
A$="E"
Else
If A%=2 And B%=4
A$="Clear"
Z$="M"
Else
If A%=3 And B%=4
@Quit
Z$="M"
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Endif
Exit If A%*B%>0
Loop
Repeat
Until Mousek=0
Return
' ------------------------------------------------------
Procedure Original_path
@Get_drive
Old_drive%=Boot_drive%
Oldpath$=Dir$(0)
If Right$(Oldpath$,1)<>"\"
Oldpath$=Oldpath$+"\"
Endif
Return
' ------------------------------------
Procedure Paint
Local B%,Y%,Z%,T%
Z$="P"
Z2$=Z$
Put 0,0,Top$
Put 0,20,Screen1$
@Recolor
@Set_color_marker
B%=7
Restore Paintbrush_data
@Read_mouse_data
Do
Mouse X%,Y%,Z%
While Z%=0 And X%>=289 And Y%<18
Mouse X%,Y%,Z%
If B%<>3
Restore Pointfinger_data
@Read_mouse_data
B%=3
Endif
If Z%=1
A$="M"
Endif
Exit If A$="M"
A$=Upper$(Inkey$)
If Len(A$)=2
@Special_key
@Set_color_marker
Endif
If Asc(A$)>=49 And Asc(A$)<=57
@Adjust_color(A$)
Endif
T%=Asc(A$)
If T%=43 Or T%=61 Or T%=45
@Adjust_color_choice(T%)
Endif
Exit If A$<>""
Wend
Exit If A$="M"
If B%<>7
Restore Paintbrush_data
@Read_mouse_data
B%=7
Endif
If Z%=1
If Point(X%,Y%)<>0
If Y%>=20
@Do_fill(X%,Y%)
Repeat
Until Mousek=0
Else
If Y%>0 And Y%<=11
Answer2%=0
P%=1
Po%=0
Repeat
If X%>=Po% And X%<=Po%+10 !Check to see if mouse is inside color box
Answer2%=1
Endif
Add Po%,18
Inc P%
Until P%=16
If Answer2%=1
Color_point%=Point(X%,Y%)
Deffill Color_point%,2,8
@Set_color_marker
Endif
Repeat
Until Mousek=0
Endif
Endif
Else
Print Chr$(7);
Repeat
Until Mousek=0
Endif
Endif
If Len(A$)=2
@Special_key
@Set_color_marker
Endif
If Asc(A$)>=49 And Asc(A$)<=57
@Adjust_color(A$)
Endif
T%=Asc(A$)
If T%=43 Or T%=61 Or T%=45
@Adjust_color_choice(T%)
Endif
B$=Upper$(A$)
Exit If ((Asc(B$)=32)+(B$="M")+(B$="E")+(B$="R")+(B$="D"))=True
Exit If ((B$="L")+(B$="S")+(B$="C"))=True
A$=Inkey$
Loop
Return
' -------------------------------------------------
Procedure Read_mouse_data
Local I%,A%,Mm$
Mm$=""
I%=1
Repeat
Read A%
Mm$=Mm$+Mki$(A%)
Inc I%
Until I%=38
Defmouse Mm$
Return
' -----------------------------------------------------
Procedure Recolor
Local P%
P%=0
Repeat
Setcolor P%,Sa%(P%)
Inc P%
Until P%=16
Return
' ------------------------------------------------------]
Procedure Reset_colors
Local P%
P%=0
Repeat
Swap Sa%(P%),Oa%(P%)
Setcolor P%,Sa%(P%)
Inc P%
Until P%=16
Return
' ------------------------------------------------------
Procedure Save_screen
Local P%
Put 0,0,Top_black$
Print At(1,1);"SAVE PICTURE"
@Fileselect("\*.*","",0,"")
If Len(Filename$)>=2
@Recolor
Put 0,0,Top$
Put 0,20,Screen1$
Hidem
R$=Right$(Filename$,3)
If R$="PI1" ! DEGAS picture selected
A%=Xbios(2)-32
P%=0
Repeat
Dpoke A%,Sa%(P%)
Add A%,2
Inc P%
Until P%=16
Bsave Filename$,Xbios(2)-34,32034
Else ! NEO picture selected
If R$="NEO"
A%=Xbios(2)-124
P%=0
Repeat
Dpoke A%,Sa%(P%)
Add A%,2
Inc P%
Until P%=16
Bsave Filename$,Xbios(2)-128,32128
Else
If Len(Filename$)>=1
P%=Instr(Filename$,".")
If P%=0
Filename$=Filename$+".PI1"
Else
Filename$=Left$(Filename$,P%-1)
Filename$=Filename$+".PI1"
Endif
A%=Xbios(2)-32
P%=0
Repeat
Dpoke A%,Sa%(P%)
Add A%,2
Inc P%
Until P%=16
Bsave Filename$,Xbios(2)-34,32034
Else
Alert 1,"|PICTURES MUST HAVE A| '.NEO' OR '.PI1'| EXTENSION.",1,"OK",X
Endif
Endif
Endif
Endif
Showm
Return
' ------------------------------------------
Procedure Set_colors
Local A%,P%
A%=0
P%=1
Put 0,0,Top_black$
Repeat
Color P%
Deffill P%,2,8
Pbox A%,1,A%+10,11
Add A%,18
Inc P%
Until P%=16
Color 1
Box 290,1,318,18
Box 295,6,313,13
Line 290,1,295,6
Line 318,1,313,6
Line 290,18,295,13
Line 318,18,313,13
Get 0,0,319,19,Top$
Return
' ------------------------------------------------
Procedure Set_color_marker
Local X%
X%=Color_point%*18-18
Color 0
Line 0,15,280,15
Box Old_marker%-1,0,Old_marker%+11,12
Color 1
Line X%-1,15,X%+11,15
Box X%-1,0,X%+11,12
Old_marker%=X%
@Color_numbers
Return
' -----------------------------------------------------
Procedure Set_color_point
Color_point%=2
Deffill 2,2,8
Return
' -----------------------------------------------------
Procedure Set_rez
Local P%,A%
P%=0
Repeat
Palette(P%)=Xbios(7,W:P%,W:-1)
Inc P%
Until P%=16
@Get_colors
A%=Xbios(2)-124
P%=0
Repeat
Sa%(P%)=Xbios(7,W:P%,W:-1)
Dpoke A%,Sa%(P%)
Sa%(P%)=Dpeek(A%)
Oa%(P%)=Sa%(P%)
Add A%,2
Inc P%
Until P%=16
Get 0,0,319,19,Top_black$
Return
' ------------------------------------------------------
Procedure Special_key
X%=Asc(Right$(A$))
If Asc(A$)=0
If X%=98
@Help
Else
If X%=97
@Change_screen
A$=Z$
If A$="M"
A$=Z2$
Endif
Else
If X%=75 ! page back
Alert 1,"|PAGING PICTURE WILL ABANDON | YOUR WORK ON THIS SCREEN.",1,"OK|CANCEL",Ab%
If Ab%=1
Dec Pcture%
If Pcture%=0
@Find_screen_number
Endif
@Auto_load
If Answer%=1 !unsuccessful load
Inc Pcture%
A$=Z$
Else
A$="P"
@Set_color_point
Endif
Else
A$=Z$
Endif
Else
If X%=77 !page forward
Alert 1,"|PAGING PICTURE WILL ABANDON | YOUR WORK ON THIS SCREEN.",1,"OK|CANCEL",Ab%
If Ab%=1
Inc Pcture%
@Auto_load
If Answer%=1
Dec Pcture%
A$=Z$
Else
A$="P"
@Set_color_point
Endif
Else
A$=Z$
Endif
Endif
Endif
Endif
Endif
Endif
Repeat !Clears multiple key press
Until Inkey$=""
Return
' -------------------------------------------
Procedure Title
Local A%,P%,C$
A%=0
C$=Bootdrive$+":"+Oldpath$+"MENU.SCR"
If Exist(C$)
P%=0
Repeat
Setcolor P%,0
Inc P%
Until P%=16
Bload C$,Xbios(2)-34
Sget Mnu$
@Make_help_screen
C$=Bootdrive$+":"+Oldpath$+"TITLE.SCR"
If Exist(C$)
Bload C$,Xbios(2)-34
Else
@Early_exit
Endif
@Get_colors
Restore Title_data
Repeat
Until Inkey$=""
While C%<>-1
Read C%,X%,Y%
Deffill C%,2,8
Fill X%,Y%
Pause 5
If Inkey$<>""
A%=6999
Endif
Exit If Mousek<>0
Exit If A%=6999
Wend
Showm
Repeat
Inc A%
Exit If A%>=7000
Exit If Inkey$<>""
Until Mousek<>0
Else
@Early_exit
Endif
Deffill 1,2,8
Pbox 0,20,319,199
Return
' -----------------------------------------------------
Procedure Trap_error
Local C$,X%
X%=Err
On Error Gosub Trap_error
If X%=-33
C$="|FILE NOT FOUND"
Else
C$="|ERROR #"+Str$(X%)
Endif
Alert 1,C$,1,"OK",X%
Resume Trap_1
Return
' --------------------------------------
Procedure Quit
Alert 3,"| |DO YOU REALLY WANT TO QUIT?",1,"YES|NO",X
If X=1
P%=0
Repeat
Setcolor P%,Palette(P%)
Inc P%
Until P%=16
Deftext 1,0,0,13
Chdrive Old_drive% !Reset Drive path
Chdir Oldpath$
End
Endif
A$="M"
Return
' -----------------------------------------------
Color_place:
Data 0,0,1,15,2,1,3,2,4,4,5,6,6,3,7,5,8,7,9,8,10,9,11,10
Data 12,12,13,14,14,11,15,13
' ---------------------------------------------
Help_screen_data:
Data P= PAINT A PICTURE
Data C= CHANGE ALL COLORS
Data D= DRAW FREEHAND LINES
Data R= DRAW RUBBERBAND LINES
Data E= ERASE PART OF A PICTURE
Data S= SAVE A PICTURE *
Data L= LOAD A PICTURE **
Data M= MAIN MENU
Data UNDO= UNDO LAST OPERATION
Data SPACE BAR= MAIN MENU,
Data USE 1 AND 3 TO ADJUST BLUE
Data USE 4 AND 6 TO ADJUST GREEN
Data USE 7 AND 9 TO ADJUST RED
Data USE 1 THRU 9 WHEN ERASING PICTURES
Data USE ⇦ AND ⇨ KEYS TO AUTO LOAD PICTURES
Data USE + AND - KEYS TO SET COLORS,
Data * USE 'NEO' OR 'PI1' EXTENSION
Data "** USE 'NEO','PI1', OR 'PC1' EXTENSION"
Data -1
' -------------------------------------------
Opencross_data:
Data &0007,&0008,&0002,&0000,&0001
Data &0000,&07C0,&0440,&0440
Data &0440,&0440,&FC7E,&8002
Data &8002,&8002,&FC7E,&0440
Data &0440,&0440,&0440,&07C0
Data &0000,&0000,&0380,&0280
Data &0280,&0280,&0280,&7EFC
Data &4004,&7EFC,&0280,&0280
Data &0280,&0280,&0380,&0000
' ------------------------------------------
Paintbrush_data:
Data &0000,&0000,&0001,&0000,&0001
Data &0000,&4000,&3000,&3C00
Data &1F00,&1F80,&0F60,&0E20
Data &0470,&0290,&0388,&00C4
Data &002A,&0015,&000A,&0004
Data &C000,&B000,&4C00,&4300
Data &2080,&2060,&1090,&11D0
Data &0B88,&0568,&0474,&033A
Data &00D5,&002A,&0015,&000A
' --------------------------------------------
Pencil_data:
Data &0000,&0000,&0001,&0000,&0001
Data &0000,&7C00,&6600,&4900
Data &5480,&6240,&3120,&1890
Data &0C48,&062C,&0312,&01A6
Data &00CC,&0078,&0030,&0000
Data &FC00,&8200,&9900,&B680
Data &AB40,&9DA0,&4ED0,&2768
Data &13B4,&09D2,&04ED,&0259
Data &0132,&0084,&0048,&0030
' ---------------------------------------------------
Pointfinger_data:
Data &0000,&0000,&0002,&0000,&0001
Data &3000,&4C00,&6200,&1980
Data &0C40,&32F8,&2904,&6624
Data &93C2,&CF42,&7C43,&2021
Data &1001,&0C41,&0380,&00C0
Data &0000,&3000,&1C00,&0600
Data &0380,&0D00,&16F8,&19D8
Data &6C3C,&30BC,&03BC,&1FDE
Data &0FFE,&03BE,&007F,&003F
' -------------------------------------------------
Title_data:
Data 11,5,22
Data 4,143,21
Data 4,309,22
Data 3,27,75
Data 3,100,30
Data 3,215,75
Data 3,292,74
Data 5,72,49
Data 5,184,52
Data 5,306,96
Data 13,219,26
Data 14,231,22
Data 13,245,22
Data 14,259,22
Data 13,273,22
Data 14,287,22
Data 15,254,70
Data 11,10,131
Data 8,23,117
Data 13,31,124
Data 13,191,117
Data 8,207,110
Data 11,220,113
Data 13,2,141
Data 14,20,139
Data 13,43,133
Data 14,71,135
Data 13,98,129
Data 13,155,127
Data 14,176,126
Data 13,214,130
Data 14,271,154
Data 13,310,140
Data 6,77,93
Data 10,74,85
Data 6,79,75
Data 10,87,62
Data 6,94,46
Data 10,112,41
Data 6,129,42
Data 10,143,44
Data 6,158,51
Data 10,170,61
Data 6,176,72
Data 10,174,82
Data 9,122,53
Data 9,124,136
Data 8,85,81
Data 8,165,82
Data 7,85,89
Data 7,163,93
Data 12,109,73
Data 12,135,74
Data 4,109,83
Data 4,135,82
Data 7,119,100
Data 8,125,92
Data 8,126,115
Data 7,126,119
Data 5,104,143
Data 8,128,180
Data 8,128,193
Data 4,223,182
Data -1,-1,-1